//
//  HNStrengtheningClassApplicationCountListModel.m
//  优学荟管理系统
//
//  Created by edz on 2017/11/27.
//  Copyright © 2017年 星道三好. All rights reserved.
//

#import "HNStrengtheningClassApplicationCountListModel.h"

@implementation HNStrengtheningClassApplicationCountListModel

// 实例化
- (instancetype)init_ValuForKeyWithDict:(NSDictionary *)Dict {
    self = [super init];
    if (self) {
        [self setValuesForKeysWithDictionary:Dict];
    }
    return self;
}

// KVO
- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    
    if ([key isEqualToString:@"id"]) {
        
        self.ID = value;
    }
    
    if ([key isEqualToString:@"elementCount"]) {
        
        [value enumerateObjectsUsingBlock:^(NSDictionary * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
            
            [self.elementCounts addObject:[[HNCourseListChartsModel alloc] init_ValuForKeyWithDict:obj]];
        }];
    }
}


- (void)setValue:(id)value forKey:(NSString *)key {
    
    if ([key isEqualToString:@"setCourseComments"]) {
        
        [value enumerateObjectsUsingBlock:^(NSDictionary * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
           [self.setCourseComments addObject:[[HNStrengtheningApplicationApplyElementModel alloc] init_ValuForKeyWithDict:obj]];
        }];
    } else {
        
        [super setValue:value forKey:key];
    }
}

- (NSMutableArray<HNStrengtheningApplicationApplyElementModel *> *)setCourseComments {
    
    if (!_setCourseComments) {
        
        _setCourseComments = [NSMutableArray array];
    }
    return _setCourseComments;
}

- (NSMutableArray<HNCourseListChartsModel *> *)elementCounts {
    
    if (!_elementCounts) {
        
        _elementCounts = [NSMutableArray array];
    }
    return _elementCounts;
}
@end
